Skip to content

Remove redundant preferredProvider variable in ProviderCommandReactor#1156

Draft
cursor[bot] wants to merge 1 commit intocodething/648ca884-claudefrom
cursor/providercommandreactor-variable-redundancy-0e6d
Draft

Remove redundant preferredProvider variable in ProviderCommandReactor#1156
cursor[bot] wants to merge 1 commit intocodething/648ca884-claudefrom
cursor/providercommandreactor-variable-redundancy-0e6d

Conversation

@cursor
Copy link
Contributor

@cursor cursor bot commented Mar 17, 2026

Summary

Removes the redundant preferredProvider variable in ProviderCommandReactor.ts that always equals threadProvider.

Details

threadProvider is defined as currentProvider ?? inferProviderForModel(thread.model). The subsequent preferredProvider was defined as currentProvider ?? threadProvider, which collapses to threadProvider in all cases:

  • When currentProvider is defined: threadProvider === currentProvider, so both resolve to currentProvider.
  • When currentProvider is undefined: the ?? falls through, so preferredProvider === threadProvider.

The fix removes the preferredProvider declaration and replaces its two usages with threadProvider.

Open in Web Open in Cursor 

Note

Remove redundant preferredProvider variable in ProviderCommandReactor

Removes the intermediate preferredProvider variable in ProviderCommandReactor.ts and uses threadProvider directly in startProviderSession. Behavioral Change: sessions started without an explicit provider now default to threadProvider instead of currentProvider ?? threadProvider.

Macroscope summarized 7b50561.

…Provider

Co-authored-by: Julius Marminge <juliusmarminge@users.noreply.github.com>
@github-actions github-actions bot added size:XS 0-9 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. labels Mar 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant